﻿@model XF.FM.Core.Table.PageData<XF.FM.TestEntities.Film>
@{
    ViewData["Title"] = "MyTable";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}
<div class="container-fluid">
    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-header">
                    <h3 class="card-title">Responsive Hover Table</h3>
                    <input id="q" type="text" />
                    <bt color="Primary" onclick="se()">查询</bt>
                    <div class="card-tools">
                        <div class="input-group input-group-sm" style="width: 150px;">
                            <input type="text" name="table_search" class="form-control float-right" placeholder="Search">

                            <div class="input-group-append">
                                <button type="submit" class="btn btn-default"><i class="fas fa-search"></i></button>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="card-body table-responsive p-0">
                    <table id="table" class="table table-hover text-nowrap">
                        <thead>
                            <tr>
                                <th>ID</th>
                                <th>User</th>
                                <th>Date</th>
                                <th>Status</th>
                                <th>Reason</th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach (var item in Model.Data)
                            {
                                <tr>
                                    <td>@item.FilmId</td>
                                    <td>@item.LastUpdate</td>
                                    <td>@item.RentalRate</td>
                                    <td>@item.Title</td>
                                    <td>@item.Description</td>
                                </tr>
                            }
                        </tbody>
                    </table>
                </div>
                <div class="card-footer clearfix">
                    <page id="page" asp-for="Model"></page>
                </div>
            </div>
        </div>
    </div>
</div>
@section Scripts{
    <script src="/js/UrlQuery.js"></script>
    <script>
        var query = new UrlQuery();
        query.page("page");
        query.on("q", function () {
            return $("#q").val();
        })
        function se() {
            query.go();
        }
    </script>
}